<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>

<%
    request.setCharacterEncoding("UTF-8");
    String htmlData = request.getParameter("content1") != null ? request.getParameter("content1") : "";
%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ include file="/WEB-INF/JSP/backHome/modalWindows/StudentsListDropexerciseThree.jsp" %>
<%@ include file="/WEB-INF/JSP/backHome/modalWindows/CartimeListPage.jsp" %>
<%@ include file="/WEB-INF/JSP/backHome/modalWindows/CoachListPage.jsp" %>
<%@ include file="/WEB-INF/JSP/backHome/modalWindows/argeeCommon.jsp" %>
<%@ include file="/WEB-INF/JSP/backHome/modalWindows/againstAuditCommon.jsp" %>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Insert title here</title>
    <script type="text/javascript" src="<%=path%>/My97DatePicker/WdatePicker.js"></script>
    <link rel="stylesheet" type="text/css" href="<%=path%>/CSS/backLayout.css">
    <link rel="stylesheet" type="text/css" href="<%=path%>/CSS/bombBox.css">
</head>
<style>
    select {
        width: 234px;
        height: 31px
    }

    .tr{
        background-color: #57a0ff;
        font-weight:700;
    }
    .tr td {
        font-size: 14px;
        color: #ffffff
    }

    .tr_td {
        height: 40px;
    }

    .tr_td td {
        border-bottom: 1px solid #ededed;
        text-align: center;
    }

    tr td:nth-child(1) {
        font-size: 14px;
        color: #cccccc
    }

    .date {
        border: 0;
        background: #ffffff;
        text-align: center;
    }

    .tr_td td:nth-child(1) {
        border-left: 1px solid #cccccc;
    }

    .tr_td td:nth-child(3) {
        border-right: 1px solid #cccccc;
    }

    .addTable.deleteTable:HOVER {
        cursor: pointer;
    }

    .botton input {
        width: 230px;
    }

    type[type='checkbox'] {
        width: 15px;
    }

    .div_body {
        min-height: 900px;
    }

    .div_zilei {
        height: 30px
    }

</style>
<body style="background: #f5f5f5">
<div class="main">
    <div id="modal-overlay">

    </div>
    <div class="weizhi">
        <c:if test="${changecoachThreeList.cfbillstate == 3}">
            练车管理>>科目三换教练>>修改
        </c:if>
        <c:if test="${changecoachThreeList.cfbillstate != 3}">
            练车管理>>科目三换教练>>查看
        </c:if>
    </div>
    <div class="div_body" style="box-shadow: 0 0 5px #cccccc; min-height: 900px;">
        <%--未审核--%>
        <c:if test="${changecoachThreeList.cfbillstate == 3}">
            <div class="div_form">
                <form id="update_shar" action="<%=path%>/DrivingSys/update_changecoachThree" onsubmit="StopRepeat()"
                      class="form" method="post">
                    <div class="div_input_hang">
                        <input type="hidden" name="fid" id="fid" value="${changecoachThreeList.fid}"/>
                        <div class="input_hang">
                            <span class="gn_name">驾校&nbsp;:&nbsp;</span>
                            <input disabled='disabled' type="text" name="name" value="${department}" readonly="readonly"
                                   style="color: gray;"/>
                        </div>
                        <div class="input_hang">
                            <span class="gn_name">单据编号&nbsp;:&nbsp;</span>
                            <input type="text" name="fnumber" id="fnumber" value="${changecoachThreeList.fnumber}"
                                   style="color: gray;"
                                   readonly="readonly"/>
                        </div>
                        <div class="input_hang">
                            <span class="gn_name">业务日期&nbsp;:&nbsp;</span>
                            <input type="text" name="fbizdate" id="fbizdate_bind"
                                   value="${changecoachThreeList.fbizdate}"
                                   onclick="WdatePicker({el:'fbizdate_bind',dateFmt:'yyyy-MM-dd'})"/>
                            <img onclick="WdatePicker({el:'fbizdate_bind',dateFmt:'yyyy-MM-dd'})"
                                 src="<%=path%>/image/date.jpg" align="absmiddle" style="padding-left: 15px">
                        </div>
                    </div>
                    <div class="div_input_hang">
                        <div class="input_hang">
                            <span class="gn_name">参考信息&nbsp;:&nbsp;</span>
                            <input name="fdescription" value="${changecoachThreeList.fdescription}"/>
                        </div>
                        <div class="input_hang">
                            <span class="gn_name">单据状态&nbsp;:&nbsp;</span>
                            <select name="cfbillstate">
                                <option id="fdescriptionL2" style="color: gray;" value="3">保存</option>
                            </select>
                        </div>
                        <div class="input_hang">
                            <span class="gn_name">练车时间&nbsp;:&nbsp;</span>
                            <input name="cflcsj" value="${changecoachThreeList.cflcsjidName}" style="color: gray;"
                                   class="is_click"
                                   onclick="clicklcsj($(this))"/>
                            <input class="cflcsjid" type="hidden" name="cflcsjid"
                                   value="${changecoachThreeList.cflcsjid}"
                                   style="color: gray;"/>
                        </div>
                    </div>
                    <div style="width: 20%; margin-left: 90px; float: left">已换学员</div>
                    <div class="div_zilei" style="margin-left: 90px; float: left">
                        <div style="width: 45%;text-align: right;">
                            <img src="<%=path%>/image/insert2323.jpg" class="addTable">
                            <span style="padding-right: 20px;color:#57a0ff;font-weight:700;font-size: 14px" class="addTable">添加</span>
                            <img src="<%=path%>/image/delete212.png" class="deleteTable">
                            <span class="deleteTable" style="color:#57a0ff;font-weight:700;font-size: 14px"
                                  class="deleteTable">删除</span>
                        </div>
                    </div>
                    <div style="overflow:auto;min-height: 390px;max-height: 390px;width: 88%;margin-left: 90px;">
                        <table id="tablejl" width="61%" style=" min-height:50px;border-spacing:0;white-space:nowrap;">
                            <tr class="tr">
                                <td align="right"><%--<input type="checkbox" name="check" class="check"
                                                         style="width: 15px;">--%></td>
                                <td width="30px">序号</td>
                                <td align="center">学员</td>
                                <td align="center">学员编号</td>
                                <td align="center">手机</td>
                                <td align="center">电话</td>
                                <td align="center">当前教练</td>
                                <td align="center">教练</td>
                                <td align="center">教练编码</td>
                                <td align="center">备注</td>
                            </tr>
                            <c:forEach items="${changecoachThreeList.changecoachthreeentryList}" var="changecoachTwo"
                                       varStatus="s">
                                <tr>
                                    <td width='20px' align='center'><input class='check2' type='checkbox' name='check2'
                                                                           style='width:15px'></td>
                                    <td><input type="text" class="fseq" name="fseq" value="${s.index+1}"
                                               readonly="readonly"></td>
                                    <td name='notcheck' align='center'><input style='width: 70px;' type='text'
                                                                              name='xyname' class="is_click"
                                                                              value='${changecoachTwo.cfstudentName}'
                                                                              onclick='clickName($(this))'/>
                                        <input type="hidden" class="cfstudentid" name="cfstudentid"
                                               value='${changecoachTwo.cfstudentid}'/><%--学员id--%>
                                    </td>
                                    <td align='center'><input readonly="readonly" unselectable="on"
                                                              style='width: 120px;'
                                                              type='text' name='cfstudentno'
                                                              value='${changecoachTwo.cfstudentno}'/>
                                    </td>
                                    <td align='center'><input readonly="readonly" unselectable="on"
                                                              style='width: 100px;'
                                                              type='text' name='cfmobile'
                                                              value='${changecoachTwo.cfmobile}'/>
                                    </td>
                                    <td align='center'><input readonly="readonly" unselectable="on"
                                                              style='width: 100px;'
                                                              type='text' name='cfphone'
                                                              value='${changecoachTwo.cfphone}'/>
                                    </td>
                                    <td align='center'><input readonly="readonly" unselectable="on" style='width: 70px;'
                                                              type='text'
                                                              name='jlname2' value='${changecoachTwo.cfcoachName2}'/>
                                        <input type="hidden" name="cfcoachid2"
                                               value="${changecoachTwo.cfcurrentcoachid}"/><%--教练id--%>
                                    </td>
                                    <td name='notcheck' align='center'><input style='width: 70px;' type='text'
                                                                              name='jlname' class="is_click"
                                                                              value='${changecoachTwo.cfcoachName}'
                                                                              onclick='clickJlname($(this))'/>
                                        <input type="hidden" name="cfcoachid" value='${changecoachTwo.cfcoachid}'/><%--教练id--%>
                                    </td>
                                    <td align='center'><input readonly="readonly" unselectable="on" style='width: 70px;'
                                                              type='text'
                                                              name='cfcoachno' value='${changecoachTwo.cfcoachno}'/>
                                    </td>

                                    <td name='notcheck' align='center'><input style='width: 150px;' type='text'
                                                                              name='cfremark'
                                                                              value='${changecoachTwo.cfremark}'/></td>
                                </tr>
                            </c:forEach>
                        </table>
                    </div>
                    <div style="line-height:31px; margin-top: 80px; height: 31px; ">
                        <div class="botton">
                            <span class="gn_name">审核人&nbsp;:&nbsp;</span>
                            <input id="shename" readonly="readonly" type="text" name="ffivouchered"
                                   value="${changecoachThreeList.checkName}">
                        </div>
                        <div class="botton">
                            <span class="gn_name">创建人&nbsp;:&nbsp;</span>
                            <input id="createname" readonly="readonly" type="text" name="createName"
                                   value="${changecoachThreeList.createName}">
                        </div>
                        <div class="botton">
                            <span class="gn_name">创建时间&nbsp;:&nbsp;</span>
                            <input id="updatetime" readonly="readonly" type="text" name="fcreatetime"
                                   value="${changecoachThreeList.fcreatetime}">
                        </div>
                    </div>

                    <div class="div_tj">
                        <shiro:hasPermission name="/go_update_changecoachThree">
                            <div>
                                <input type="button" class="input_submit bc" onclick="audit(2)" value="">
                            </div>
                        </shiro:hasPermission>
                        <shiro:hasPermission name="/submitChangecoachThree">
                            <div>
                                <input type="button" class="input_submit tj" value="" onclick="submitTj()"/>
                            </div>
                        </shiro:hasPermission>
                        <div>
                            <input type="button" class="input_submit cklc" value=""
                                   onclick="lookActivitiImg('publicProcess',$('#fnumber').val())">
                        </div>
                        <div>
                            <input type="button" class="input_back fh" value=""
                                   onclick="back()"/>
                        </div>
                    </div>
                </form>
            </div>
        </c:if>
        <%--提交--%>
        <c:if test="${changecoachThreeList.cfbillstate == 4}">
            <div class="div_form">
                <form id="update_shar" action="<%=path%>/DrivingSys/update_changecoachThree" class="form" method="post">
                    <div class="div_input_hang">
                        <input type="hidden" name="fid" id="fid" value="${changecoachThreeList.fid}"/>
                        <div class="input_hang">
                            <span class="gn_name">驾校&nbsp;:&nbsp;</span>
                            <input disabled='disabled' type="text" name="name" value="${department}" readonly="readonly"
                                   style="color: gray;"/>
                        </div>
                        <div class="input_hang">
                            <span class="gn_name">单据编号&nbsp;:&nbsp;</span>
                            <input type="text" name="fnumber" id="fnumber" value="${changecoachThreeList.fnumber}"
                                   style="color: gray;"
                                   readonly="readonly"/>
                        </div>
                        <div class="input_hang">
                            <span class="gn_name">业务日期&nbsp;:&nbsp;</span>
                            <input type="text" name="fbizdate" id="fbizdate_bind"
                                   value="${changecoachThreeList.fbizdate}"
                                   readonly="readonly"/>
                            <img
                                    src="<%=path%>/image/date.jpg" align="absmiddle" style="padding-left: 15px">
                        </div>
                    </div>
                    <div class="div_input_hang">
                        <div class="input_hang">
                            <span class="gn_name">参考信息&nbsp;:&nbsp;</span>
                            <input name="fdescription" value="${changecoachThreeList.fdescription}"/>
                        </div>
                        <div class="input_hang">
                            <span class="gn_name">单据状态&nbsp;:&nbsp;</span>
                            <select name="cfbillstate">
                                <option id="fdescriptionL2" style="color: gray;" value="4">提交</option>
                            </select>
                        </div>
                        <div class="input_hang">
                            <span class="gn_name">练车时间&nbsp;:&nbsp;</span>
                            <input name="cflcsj" value="${changecoachThreeList.cflcsjidName}" style="color: gray;"
                                   class="is_click"
                                   readonly="readonly"/>
                            <input class="cflcsjid" type="hidden" name="cflcsjid"
                                   value="${changecoachThreeList.cflcsjid}"
                                   style="color: gray;"/>
                        </div>
                    </div>
                    <div style="width: 20%; margin-left: 90px; float: left">已换学员</div>
                    <div class="div_zilei" style="margin-left: 90px; float: left">
                    </div>
                    <div style="overflow:auto;min-height: 390px;max-height: 390px;width: 88%;margin-left: 90px;">
                        <table id="tablejl" width="61%" style=" min-height:50px;border-spacing:0;white-space:nowrap;">
                            <tr class="tr">
                                <td align="right"><%--<input type="checkbox" name="check" class="check"
                                                         style="width: 15px;">--%></td>
                                <td width="30px">序号</td>
                                <td align="center">学员</td>
                                <td align="center">学员编号</td>
                                <td align="center">手机</td>
                                <td align="center">电话</td>
                                <td align="center">当前教练</td>
                                <td align="center">教练</td>
                                <td align="center">教练编码</td>
                                <td align="center">备注</td>
                            </tr>
                            <c:forEach items="${changecoachThreeList.changecoachthreeentryList}" var="changecoachTwo"
                                       varStatus="s">
                                <tr>
                                    <td width='20px' align='center'><input class='check2' type='checkbox' name='check2'
                                                                           style='width:15px'></td>
                                    <td><input type="text" class="fseq" name="fseq" value="${s.index+1}"
                                               readonly="readonly"></td>
                                    <td name='notcheck' align='center'><input style='width: 70px;' type='text'
                                                                              name='xyname' class="is_click"
                                                                              value='${changecoachTwo.cfstudentName}'
                                                                              readonly="readonly"/>
                                        <input type="hidden" name="cfstudentid" class="cfstudentid"
                                               value='${changecoachTwo.cfstudentid}'/><%--学员id--%>
                                    </td>
                                    <td align='center'><input readonly="readonly" unselectable="on"
                                                              style='width: 120px;'
                                                              type='text' name='cfstudentno'
                                                              value='${changecoachTwo.cfstudentno}'/>
                                    </td>
                                    <td align='center'><input readonly="readonly" unselectable="on"
                                                              style='width: 100px;'
                                                              type='text' name='cfmobile'
                                                              value='${changecoachTwo.cfmobile}'/>
                                    </td>
                                    <td align='center'><input readonly="readonly" unselectable="on"
                                                              style='width: 100px;'
                                                              type='text' name='cfphone'
                                                              value='${changecoachTwo.cfphone}'/>
                                    </td>
                                    <td align='center'><input readonly="readonly" unselectable="on" style='width: 70px;'
                                                              type='text'
                                                              name='jlname2' value='${changecoachTwo.cfcoachName2}'/>
                                        <input type="hidden" name="cfcoachid2"
                                               value="${changecoachTwo.cfcurrentcoachid}"/><%--教练id--%>
                                    </td>
                                    <td name='notcheck' align='center'><input style='width: 70px;' type='text'
                                                                              name='jlname' class="is_click"
                                                                              value='${changecoachTwo.cfcoachName}'
                                                                              readonly="readonly"/>
                                        <input type="hidden" name="cfcoachid" value='${changecoachTwo.cfcoachid}'/><%--教练id--%>
                                    </td>
                                    <td align='center'><input readonly="readonly" unselectable="on" style='width: 70px;'
                                                              type='text'
                                                              name='cfcoachno' value='${changecoachTwo.cfcoachno}'/>
                                    </td>

                                    <td name='notcheck' align='center'><input style='width: 150px;' type='text'
                                                                              name='cfremark' readonly="readonly"
                                                                              value='${changecoachTwo.cfremark}'/></td>
                                </tr>
                            </c:forEach>
                        </table>
                    </div>
                    <div style="line-height:31px; margin-top: 80px; height: 31px; ">
                        <div class="botton">
                            <span class="gn_name">审核人&nbsp;:&nbsp;</span>
                            <input id="shename" readonly="readonly" type="text" name="ffivouchered"
                                   value="${changecoachThreeList.checkName}">
                        </div>
                        <div class="botton">
                            <span class="gn_name">创建人&nbsp;:&nbsp;</span>
                            <input id="createname" readonly="readonly" type="text" name="createName"
                                   value="${changecoachThreeList.createName}">
                        </div>
                        <div class="botton">
                            <span class="gn_name">创建时间&nbsp;:&nbsp;</span>
                            <input id="updatetime" readonly="readonly" type="text" name="fcreatetime"
                                   value="${changecoachThreeList.fcreatetime}">
                        </div>
                    </div>

                    <div class="div_tj">
                        <c:if test="${AuditState == 'true'}">
                            <shiro:hasPermission name="/auditChangecoachThree">
                                <div>
                                    <input type="button" class="input_submit sh" value="" onclick="examine(5)"/>
                                </div>
                            </shiro:hasPermission>
                        </c:if>
                        <shiro:hasPermission name="/againstAuditChangecoachTwo">
                            <div>
                                <input type="button" class="input_submit fsh" onclick="examine(3)" value="">
                            </div>
                        </shiro:hasPermission>
                        <div>
                            <input type="button" class="input_submit cklc" value=""
                                   onclick="lookActivitiImg('publicProcess',$('#fnumber').val())">
                        </div>
                        <div>
                            <input type="button" class="input_back fh" value=""
                                   onclick="back()"/>
                        </div>
                    </div>
                </form>
            </div>
        </c:if>
        <%--审核--%>
        <c:if test="${changecoachThreeList.cfbillstate == 5}">
            <div class="div_form">
                <form id="update_shar" action="<%=path%>/DrivingSys/update_changecoachThree" class="form"
                      method="post">
                    <div class="div_input_hang">
                        <input type="hidden" name="fid" id="fid" value="${changecoachThreeList.fid}"/>
                        <div class="input_hang">
                            <span class="gn_name">驾校&nbsp;:&nbsp;</span>
                            <input disabled='disabled' type="text" name="name" value="${department}"
                                   readonly="readonly"
                                   style="color: gray;"/>
                        </div>
                        <div class="input_hang">
                            <span class="gn_name">单据编号&nbsp;:&nbsp;</span>
                            <input type="text" name="fnumber" id="fnumber" value="${changecoachThreeList.fnumber}"
                                   style="color: gray;"
                                   readonly="readonly"/>
                        </div>
                        <div class="input_hang">
                            <span class="gn_name">业务日期&nbsp;:&nbsp;</span>
                            <input type="text" name="fbizdate" id="fbizdate_bind"
                                   value="${changecoachThreeList.fbizdate}"
                                   readonly="readonly"/>
                            <img
                                    src="<%=path%>/image/date.jpg" align="absmiddle" style="padding-left: 15px">
                        </div>
                    </div>
                    <div class="div_input_hang">
                        <div class="input_hang">
                            <span class="gn_name">参考信息&nbsp;:&nbsp;</span>
                            <input name="fdescription" value="${changecoachThreeList.fdescription}"/>
                        </div>
                        <div class="input_hang">
                            <span class="gn_name">单据状态&nbsp;:&nbsp;</span>
                            <select name="cfbillstate">
                                <option id="fdescriptionL2" style="color: gray;" value="5">审核</option>
                            </select>
                        </div>
                        <div class="input_hang">
                            <span class="gn_name">练车时间&nbsp;:&nbsp;</span>
                            <input name="cflcsj" value="${changecoachThreeList.cflcsjidName}" style="color: gray;"
                                   class="is_click"
                                   readonly="readonly"/>
                            <input class="cflcsjid" type="hidden" name="cflcsjid"
                                   value="${changecoachThreeList.cflcsjid}"
                                   style="color: gray;"/>
                        </div>
                    </div>
                    <div style="width: 20%; margin-left: 90px; float: left">已换学员</div>
                    <div class="div_zilei" style="margin-left: 90px; float: left">
                    </div>
                    <div style="overflow:auto;min-height: 390px;max-height: 390px;width: 88%;margin-left: 90px;">
                        <table id="tablejl" width="61%" style=" min-height:50px;border-spacing:0;white-space:nowrap;">
                            <tr class="tr">
                                <td align="right"><%--<input type="checkbox" name="check" class="check"
                                                         style="width: 15px;">--%></td>
                                <td width="30px">序号</td>
                                <td align="center">学员</td>
                                <td align="center">学员编号</td>
                                <td align="center">手机</td>
                                <td align="center">电话</td>
                                <td align="center">当前教练</td>
                                <td align="center">教练</td>
                                <td align="center">教练编码</td>
                                <td align="center">备注</td>
                            </tr>
                            <c:forEach items="${changecoachThreeList.changecoachthreeentryList}" var="changecoachTwo"
                                       varStatus="s">
                                <tr>
                                    <td width='20px' align='center'><input class='check2' type='checkbox' name='check2'
                                                                           style='width:15px'></td>
                                    <td><input type="text" class="fseq" name="fseq" value="${s.index+1}"
                                               readonly="readonly"></td>
                                    <td name='notcheck' align='center'><input style='width: 70px;' type='text'
                                                                              name='xyname' class="is_click"
                                                                              value='${changecoachTwo.cfstudentName}'
                                                                              readonly="readonly"/>
                                        <input type="hidden" name="cfstudentid" class="cfstudentid"
                                               value='${changecoachTwo.cfstudentid}'/><%--学员id--%>
                                    </td>
                                    <td align='center'><input readonly="readonly" unselectable="on"
                                                              style='width: 120px;'
                                                              type='text' name='cfstudentno'
                                                              value='${changecoachTwo.cfstudentno}'/>
                                    </td>
                                    <td align='center'><input readonly="readonly" unselectable="on"
                                                              style='width: 100px;'
                                                              type='text' name='cfmobile'
                                                              value='${changecoachTwo.cfmobile}'/>
                                    </td>
                                    <td align='center'><input readonly="readonly" unselectable="on"
                                                              style='width: 100px;'
                                                              type='text' name='cfphone'
                                                              value='${changecoachTwo.cfphone}'/>
                                    </td>
                                    <td align='center'><input readonly="readonly" unselectable="on" style='width: 70px;'
                                                              type='text'
                                                              name='jlname2' value='${changecoachTwo.cfcoachName2}'/>
                                        <input type="hidden" name="cfcoachid2"
                                               value="${changecoachTwo.cfcurrentcoachid}"/><%--教练id--%>
                                    </td>
                                    <td name='notcheck' align='center'><input style='width: 70px;' type='text'
                                                                              name='jlname' class="is_click"
                                                                              value='${changecoachTwo.cfcoachName}'
                                                                              readonly="readonly"/>
                                        <input type="hidden" name="cfcoachid" value='${changecoachTwo.cfcoachid}'/><%--教练id--%>
                                    </td>
                                    <td align='center'><input readonly="readonly" unselectable="on" style='width: 70px;'
                                                              type='text'
                                                              name='cfcoachno' value='${changecoachTwo.cfcoachno}'/>
                                    </td>

                                    <td name='notcheck' align='center'><input style='width: 150px;' type='text'
                                                                              name='cfremark' readonly="readonly"
                                                                              value='${changecoachTwo.cfremark}'/></td>
                                </tr>
                            </c:forEach>
                        </table>
                    </div>
                    <div style="line-height:31px; margin-top: 80px; height: 31px;">
                        <div class="botton">
                            <span class="gn_name">审核人&nbsp;:&nbsp;</span>
                            <input id="shename" readonly="readonly" type="text" name="ffivouchered"
                                   value="${changecoachThreeList.checkName}">
                        </div>
                        <div class="botton">
                            <span class="gn_name">创建人&nbsp;:&nbsp;</span>
                            <input id="createname" readonly="readonly" type="text" name="createName"
                                   value="${changecoachThreeList.createName}">
                        </div>
                        <div class="botton">
                            <span class="gn_name">创建时间&nbsp;:&nbsp;</span>
                            <input id="updatetime" readonly="readonly" type="text" name="fcreatetime"
                                   value="${changecoachThreeList.fcreatetime}">
                        </div>
                    </div>

                    <div class="div_tj">
                        <shiro:hasPermission name="/againstAuditChangecoachTwo">
                            <div>
                                <input type="button" class="input_submit fsh" onclick="examine(3)" value="">
                            </div>
                        </shiro:hasPermission>
                        <div>
                            <input type="button" class="input_submit cklc" value=""
                                   onclick="lookActivitiImg('publicProcess',$('#fnumber').val())">
                        </div>
                        <div>
                            <input type="button" class="input_back fh" value=""
                                   onclick="back()"/>
                        </div>
                    </div>
                </form>
            </div>
        </c:if>

    </div>
</div>
</body>
<script type="text/javascript" src="<%=path%>/JQuery/jquery-1.8.2.js"></script>
<script type="text/javascript" src="<%=path%>/HoganJS/handlebars-v4.0.11.js"></script>
<script type="text/javascript">


    //选中的删除
    $(".deleteTable").click(function () {
        var tr_len = $("#tablejl tr").length;
            var s = '';
            $('input:checkbox[name=check2]').each(function (i) {

                if ($(this).is('.check2:checked')) {

                    $(this).parent().parent().remove();
                    s = '1';
                    reorder()
                }
            })

            //判断是否选中
            if (s == null || s == '') {
                alert("请选择一条数据删除");
                return false;
            }
    })
    //设置全选功选
    $('.check').click(function () {
        if ($(this).attr("checked")) {
            $(".check2:checkbox").prop("checked", true)
        } else {
            $('.check2:checkbox').removeAttr('checked')
        }
    })
    //由于和input:checkbox冲突，在选择一次
    $("#tablejl tr td .check2:checkbox").live('click', function () {
        if ($(this).is('.check2:checked')) {
            $(this).removeAttr("checked");
        } else {
            $(this).attr("checked", ".check2:checked")
        }
    })
    //单击选中
    $("#tablejl tr td").live('click', function () {
        if ($(this).parent().find(".check2:checkbox").is(':checked')) {
            $(this).parent().find(".check2:checkbox").removeAttr("checked");
        } else {
            $(this).parent().find(".check2:checkbox").attr("checked", ":checked")
        }
    })

    function submitTj() {

        $.messager.confirm('提示', '是否提交,提交后不会改变修改后的值', function (r) {

            if (r) {
                $.ajax({
                    url: '<%=path%>/DrivingSys/queryChangecoachThreeSubmit',
                    type: "post",
                    data: {
                        'fid': $('#fid').val(),
                        'fnumber': $('#fnumber').val()
                    },
                    dataType: "json",
                    success: function (res) {
                        showAlert(res.msg, 'queryChangecoachThree/look.action?state=first');
                    },
                    error: function () {
                        alert('错误');
                    }
                })
            }
        });

    }


    $('#auditsubmit').click(function () {
        $('.auditcheck').each(function () {
            if ($(this).is(':checked')) {
                $.ajax({
                    url: '<%=path%>/DrivingSys/queryChangecoachThreeExamine',
                    type: "post",
                    data: {
                        'fid': $('#fid').val(),
                        'state': _state,
                        'fnumber': $('#fnumber').val(),
                        'agreed': $(this).val(),
                        'auditcomment': $('#auditcomment').val()
                    },
                    dataType: "json",
                    success: function (res) {
                        showAlert(res.msg, 'queryChangecoachThree/look.action?state=first');
                    },
                    error: function () {
                        alert('错误');
                    }
                })
            } else {

            }
        })
    })
    //反审核按钮
    $('#againstAuditsubmit').click(function () {
        $.ajax({
            url: '<%=path%>/DrivingSys/queryChangecoachThreeExamine',
            type: "post",
            data: {
                'fid': $('#fid').val(),
                'state': _state,
                'fnumber': $('#fnumber').val(),
                'auditcomment': $('#againstAuditcomment').val()
            },
            dataType: "json",
            success: function (res) {
                showAlert(res.msg, 'queryChangecoachThree/look.action?state=first');
            },
            error: function () {
                alert('错误');
            }
        })
    })

    function examine(state) {
        _state = state;
        if (state == 5) {
            $('#modal-overlay').css('visibility', 'visible')
            $('.modal-data9').css('visibility', 'visible')
        }
        else if (state == 3) {
            $('#modal-overlay').css('visibility', 'visible')
            $('.modal-data10').css('visibility', 'visible')
        }
    }

    //改变审核状态
    function audit(state) {
        //改变单据状态
        $("#fdescriptionL2").val(state);
        //写入审核人标记
        $("#shename").val(state);
        chcek();
        if ($('#update_shar').find("tr").length == 1) {
            alert('请至少选择一条数据！')
            return false;
        }
        $('#update_shar').submit()
    }

    $('.addTable').click(function () {
        fseq = CalculateMaxNum('tablejl')
        var htmlperson = "<tr>" +
            "<td width='20px' align='center'><input class='check2' type='checkbox' name='check2' style='width:15px'></td>" +
            " <td><input type='text' class='fseq' name='fseq' value='" + fseq + "' readonly='readonly'></td>" +
            "<td name='notcheck' align='center'><input style='width: 70px;' type='text' name='xyname' value='' class='is_click' onclick='clickName($(this))'/>" +
            "<input type='hidden'  class='cfstudentid'  name='cfstudentid'/></td><td align='center'>" +
            "<input readonly='readonly' unselectable='on' style='width: 120px;' type='text'  name='cfstudentno' value=''/></td>" +
            "<td align='center'><input readonly='readonly' unselectable='on' style='width: 100px;' type='text' name='cfmobile' value=''/></td>" +
            "<td align='center'><input readonly='readonly' unselectable='on' style='width: 100px;' type='text' name='cfphone' value=''/></td>" +
            "<td align='center'><input readonly='readonly' unselectable='on' style='width: 70px;' type='text' name='jlname2' value=''/>" +
            "<input type='hidden' name='cfcoachid2'/></td><td name='notcheck' align='center'>" +
            "<input style='width: 70px;' type='text' name='jlname' value='' onclick='clickJlname($(this))' class='is_click' /><input type='hidden' name='cfcoachid'/></td>" +
            "<td align='center'><input readonly='readonly' unselectable='on' style='width: 70px;' type='text' name='cfcoachno' value=''/> " +
            "</td><td name='notcheck' align='center'><input style='width: 150px;' type='text'name='cfremark' value=''/></td></tr>";
        $("#tablejl").append(htmlperson)
    })

    function addStu() {
        fseq = CalculateMaxNum('tablejl')
        var htmlperson = "<tr>" +
            "<td width='20px' align='center'><input class='check2' type='checkbox' name='check2' style='width:15px'></td>" +
            " <td><input type='text' class='fseq' name='fseq' value='" + fseq + "' readonly='readonly'></td>" +
            "<td name='notcheck' align='center'><input style='width: 70px;' type='text' class='is_click' name='xyname' value='' onclick='clickName($(this))'/>" +
            "<input type='hidden' class='cfstudentid'  name='cfstudentid'/></td><td align='center'>" +
            "<input readonly unselectable='on' readonly='readonly' style='width: 120px;' type='text' name='cfstudentno' value=''/></td>" +
            "<td align='center'><input readonly='readonly' unselectable='on' style='width: 100px;' type='text' name='cfmobile' value=''/></td>" +
            "<td align='center'><input readonly='readonly' readonly unselectable='on' style='width: 100px;' type='text' name='cfphone' value=''/></td>" +
            "<td align='center'><input readonly='readonly' readonly unselectable='on' style='width: 70px;' type='text' name='jlname2' value=''/>" +
            "<input type='hidden' name='cfcoachid2'/></td><td name='notcheck' align='center'>" +
            "<input  style='width: 70px;' type='text' name='jlname' value='' class='is_click' onclick='clickJlname($(this))'/><input type='hidden' name='cfcoachid'/></td>" +
            "<td align='center'><input readonly unselectable='on' style='width: 70px;' type='text' name='cfcoachno' value=''/> " +
            "</td><td name='notcheck' align='center'><input style='width: 150px;' type='text'name='cfremark' value=''/></td></tr>";
        $("#tablejl").append(htmlperson)
    }

    //改变复选框的值
    function chcek() {
        $(".cfduizhang2").each(function () {
            if ($(this).is(':checked')) {
                $(this).next().val(0);
            } else {
                $(this).next().val(1);
            }
        });
        $(".cfstuvip2").each(function () {
            if ($(this).is(':checked')) {
                $(this).next().val(0);
            } else {
                $(this).next().val(1);
            }
        });

    }

    /* 关闭弹出框    */
    $('.btn').click(function () {
        $('#modal-overlay').css('visibility', 'hidden')
        $('.modal-data').css('visibility', 'hidden')
        $('.modal-data1').css('visibility', 'hidden')
        $('.modal-data3').css('visibility', 'hidden')
        $('.modal-data9').css('visibility', 'hidden')
        $('.modal-data10').css('visibility', 'hidden')
        $('.data-checkbox:checkbox').removeAttr('checked');
        $('.data1-checkbox:checkbox').removeAttr('checked');
        $('.data3-checkbox:checkbox').removeAttr('checked');
        $('.page').hide();
    })

    //弹出练车时间的信息框
    function clicklcsj(e) {
        $('#modal-overlay').css('visibility', 'visible')
        $('.modal-data3').css('visibility', 'visible')
        $('data-checkbox3:checkbox').removeAttr('checked');
        $('.page').show();
        _this = e;
    }

    //弹出模式框教练信息
    function clickJlname(e) {
        $('#modal-overlay').css('visibility', 'visible')
        $('.modal-data1').css('visibility', 'visible')
        $('data-checkbox1:checkbox').removeAttr('checked');
        $('.page').show();
        _this = e.parent().parent();
    }

    //弹出模式框学生信息
    function clickName(e) {
        $('#modal-overlay').css('visibility', 'visible')
        $('.modal-data').css('visibility', 'visible')
        $('data-checkbox:checkbox').removeAttr('checked');
        _this = e.parent().parent();
        myname = $('.name1').val();
        cflcsjid = $('.cflcsjid').val();
        index = 1
        $('#studebntList').html("<div class='loading'></div>");
        $.ajax({
            url: '<%=path2%>/DrivingSys/getPageDropexercise',
            type: "post",
            data: {
                'pindex': '0',
                'name': myname,
                'cflcsjid': cflcsjid,
                'state': 3
            },
            dataType: "json",
            success: function (res) {
                $('#studebntList').html(myTemplate(res));
                $('#totalPage').val(res.pb);
            },
            error: function () {
                alert('Error');
            }
        });
    }

    //把选中的信息名称填充到输入框中
    $('#subtn1').click(function () {
        var spCodesTemp = "";
        $('input:checkbox[name=personfid]:checked').each(function (i) {
            spCodesTemp = $(this).val();
        });

        $.ajax({
            url: '<%=path%>/DrivingSys/selectPersonByFidAsPage',
            type: "post",
            data: {'id': spCodesTemp},
            dataType: "json",
            success: function (res) {
                res = res[0]
                _this.children().children('input[name=cfcoachid]').val(res.fid);
                _this.children().children('input[name=jlname]').val(res.jlname);
                _this.children().children('input[name=cfcoachno]').val(res.jlbumber);

                $('#modal-overlay').css('visibility', 'hidden')
                $('.modal-data1').css('visibility', 'hidden')
            },
            error: function () {
                alert('Error');
            }
        });

    });


    //把选中的学生信息名称填充到输入框中
    $('.subtn').click(function () {
        var spCodesTemp = "";
        $('input:checkbox[name=student]:checked').each(function (i) {
            spCodesTemp = $(this).val();
        });

        var eachcount = 0;

        $.ajax({
            url: '<%=path%>/DrivingSys/selStudentsBySharecartwo',
            type: "post",
            data: {
                'id': spCodesTemp,
                'state': '3'
            },
            dataType: "json",
            success: function (res) {
                res = res[0];
                $('.cfstudentid').each(function () {

                    if ($(this).val() == res.fid) {
                        alert('学员' + res.xyname + '信息重复！');
                        return false;
                    }

                    eachcount++

                    if (eachcount >= $(".cfstudentid").length) {
                        addData(res)
                    }

                })
            },
            error: function () {
                alert('Error');
            }
        });

    });

    function addData(res) {

        _this.children().children('input[name=xyname]').val(res.xyname);
        _this.children().children('input[name=cfstudentid]').val(res.fid);
        _this.children().children('input[name=cfstudentno]').val(res.cfstudentno);
        _this.children().children('input[name=cfmobile]').val(res.cfmobile);
        _this.children().children('input[name=cfphone]').val(res.cfphone);
        _this.children().children('input[name=jlname2]').val(res.jlname);
        /*当前教练*/
        _this.children().children('input[name=cfcoachid2]').val(res.cfcoachid);
        /*_this.children().children('input[name=cfcoachno]').val(res.jlbumber);*/

        $('#modal-overlay').css('visibility', 'hidden')
        $('.modal-data').css('visibility', 'hidden')
    }

    //返回
    function back() {
        parent.closeSelectCard()
        //location = '<%=path%>/DrivingSys/queryChangecoachThree/look.action?state=first';
    }

</script>
<%@ include file="/WEB-INF/JSP/ajax.jsp" %>
</html>